<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<div class="panel panel-default" >
    <div class="panel-heading" >
        Register
    </div>
    <div class="container-fluid">
        <form:form class="form-horizontal" id="loginForm" action="${pageContext.request.contextPath}/customer/create" method="post" modelAttribute="customer">
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Voornaam</label>
                    <div class="col-md-3 col-sm-6">
                        <form:input class="form-control" type='text' path='name' placeholder="voornaam"/>                          
                        <form:errors path="name" cssClass="error" />
                    </div>
                </div>                   
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Achternaam</label>
                    <div class="col-md-3 col-sm-6">
                        <form:input class="form-control" type='text' path='lastname' placeholder="achternaam"/>
                        <form:errors path="lastname" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Adres</label>
                    <div class="col-md-3 col-sm-6">
                        <form:input class="form-control" type='text' path='streetAddress' placeholder="straat"/>
                        <form:errors path="streetAddress" cssClass="error" />                      
                    </div>
                    <div class="col-md-2 col-sm-2">
                        <form:input class="form-control" type='text' path='houseNumber' placeholder="nummer"/>
                        <form:errors path="houseNumber" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Stad</label>
                    <div class="col-md-3 col-sm-4">
                        <form:input class="form-control" type='text' path='city' placeholder="stad" />
                        <form:errors path="city" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Telefoonnummer</label>
                    <div class="col-md-3 col-sm-6">
                        <form:input class="form-control" type='text' path='telephone1' placeholder="telefoonnummer"/>
                        <form:errors path="telephone1" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Emailadres</label>
                    <div class="col-md-3 col-sm-6">
                        <form:input class="form-control" type='text' path='email' placeholder="email"/>                            
                        <form:errors path="email" cssClass="error" />
                    </div>
                </div>
            </div>
            <hr/>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Gebruikersnaam</label>
                    <div class="col-md-4 col-sm-4">
                        <form:input class="form-control" type='text' path='moviefanUser.username' placeholder="gebruikersnaam"/>
                        <form:errors path="moviefanUser.username" cssClass="error" />
                    </div>
                </div>
            </div>           
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Wachtwoord</label>
                    <div class="col-md-4 col-sm-4">
                        <form:password class="form-control" path='moviefanUser.password' placeholder="wachtwoord"/>
                        <form:errors path="moviefanUser.password" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Bevestig wachtwoord</label>
                    <div class="col-md-4 col-sm-4">
                        <form:password class="form-control" path='moviefanUser.passwordConfirm' placeholder="bevestigwachtwoord"/>
                        <form:errors path="moviefanUser.passwordConfirm" cssClass="error" />
                        <form:errors path="moviefanUser" cssClass="error" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <label class="col-md-3 col-sm-3 control-label">Vestiging</label>
                    <div class="col-md-4 col-sm-4">
                        <div class="col-md-4 col-sm-4"> <form:select path="vestigingID" items="${vestigingen}" /></div>
                    </div>
                </div>
            </div>

            <form:input type="hidden" path="klantnummer" value='${nieuwKlantnummer}'/>
            <div class="col-md-3"></div>
            <input class="btn" id="submit" name="submit" type="submit" value="Registreer"/>
        </form:form>
    </div>
</div>